package com.test;

import java.util.ArrayList;

public class Studentlist {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();
        Student st1 = new Student("lisi",25);
        Student st2 = new Student("张三",25);
        Student st3 = new Student("王五",24);
        list.add(st1);
        list.add(st2);
        list.add(st3);
        System.out.println(list);
        for (int i = 0; i < list.size(); i++) {
            Student st = list.get(i);
            System.out.println(st.getName()+st.getAge());
        }
    }
}
